//
//  MTChatRoomTopRateCell.swift
//  MT
//
//  Created by ooops on 2020/5/14.
//  Copyright © 2020 张强. All rights reserved.
//

import UIKit
import MTCategory
import RollingNotice_Swift

class MTChatRoomTopRateCell: GYNoticeViewCell {
    
    class func reuseIdentity() -> String {
        return "MTChatRoomTopRateCellId"
    }
    
    var model: MTRankingInfoModel? {
        didSet {
            if let m = model {
                rightLabel.text = "\(m.nickname ?? "") 成为今日\(m.rankingType == 1 ? "魅力" : "实力")榜榜首"
            }
        }
    }
    
    required init(reuseIdentifier: String?, textLabelLeading: CGFloat = 10, textLabelTrailing: CGFloat = 10) {
        super.init(reuseIdentifier: reuseIdentifier)
        setupUI()
        makeConstraint()
        backgroundColor = UIColor.text.x1d1a1a
    }
    
    lazy var rightLabel: UILabel = {
        let l = UILabel()
        l.font = PingFangSCSemiboldFont(12)
        l.textColor = UIColor(hex: 0xffc000)
        l.textAlignment = .center
        l.text = "ooops 获得今日榜首"
        return l
    }()
    
    private func setupUI() {
        addSubview(rightLabel)
    }
    
    private func makeConstraint() {
        rightLabel.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }


}
